class Admins::AttachmentsController < Admins::BaseController

  protect_from_forgery with: :null_session

  def upload
    Rails.logger.info "Started New"

    @attachment = Attachment.new
    @attachment.photo = params[:upload_file]
    respond_to do |format|
      if @attachment.save
        format.json{ render :json => {file_path: @attachment.photo} }
      else
        format.json{ render :json => [@attachment.errors.to_a], :status => 403 }
      end
    end
  end

end
